package com.yx1996.bean.day03.tx.AccountDao;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

public class AccountDaoImpl extends JdbcDaoSupport implements AccountDao {


    @Override
    //加钱
    public void addMoney(Integer id, Double money) {

        super.getJdbcTemplate().update("update account set money=money+? where id=? ",money,id);
    }

    @Override
    //减钱
    public void redMoney(Integer id, Double money) {

        super.getJdbcTemplate().update("update account set money=money-? where id=? ",money,id);
    }
}
